/*
 * @Date: 2023-11-16 15:30:08
 * @LastEditors: 春贰
 * @gitee: https://gitee.com/chun22222222
 * @github: https://github.com/chun222
 * @Desc:
 * @LastEditTime: 2023-11-28 11:30:19
 * @FilePath: \server\system\model\RequestModel\main.go
 */
package RequestModel

import (
	"time"

	"go-easy-dashboard/system/model/CommonModel"
)

type Login struct {
	Loginname string `json:"loginname"`                // 用户名
	Password  string `json:"password" `                // 密码
	Photo     string `json:"photo"`                    // 人脸识别
	Kick      uint   `json:"kick"  binding:"required"` //99：强制登录,1：已经登录需要询问，0：直接可以登录
	LoginType uint   `json:"login_type"`               //1表示mes用户登陆，2表示域账户登陆
	Ip        string `json:"ip"`
}

type LoginLog struct {
	CommonModel.PageInfo
	UserId    uint        `json:"user_id" search:"="` // 主键ID
	LoginName string      `json:"login_name" search:"like"`
	UserName  string      `json:"user_name"  search:"like"`
	Status    int         `json:"status" search:"="`
	Msg       string      `json:"msg" search:"like"`
	Ip        string      `json:"ip"  search:"like"`
	Login     []time.Time `json:"login" search:"btw"`
	Logout    []time.Time `json:"logout" search:"btw"`
	LoginWay  uint        `json:"login_way" search:"="`
	CreatedAt []time.Time `json:"create_time" search:"btw"` // 创建时间
}

type SysSetRoles struct {
	LoginName string   `json:"login_name" binding:"required"`
	RoleNames []string `json:"role_names" binding:"required"`
}

type SysUserSearch struct {
	CommonModel.PageInfo
	LoginName string      `json:"login_name" search:"like"`
	UserName  string      `json:"user_name" search:"like"`
	Status    int         `json:"status" search:"="`
	Email     string      `json:"email" search:"like"`
	Phone     string      `json:"phone" search:"like"`
	CreatedAt []time.Time `json:"create_time" search:"btw"`
	UpdatedAt []time.Time `json:"update_time" search:"btw"`
}

type SysPermissionSearch struct {
	Name       string `json:"name" search:"like"`
	Title      string `json:"title" search:"like"`
	Path       string `json:"path" search:"like"`
	Sort       uint   `json:"sort" search:"="`
	Type       string `json:"type" search:"="`
	Status     uint   `json:"status" search:"="`
	Isrecord   uint   `json:"isrecord" search:"="`
	Isshowmenu uint   `json:"isshowmenu" search:"="`
}

type SysRoleSearch struct {
	Name  string `json:"name" search:"like"`
	Title string `json:"title" search:"like"`
}

type SysSetPermissions struct {
	Name            string   `json:"name" binding:"required"`
	CheckedKeys     []string `json:"checkedkeys" binding:"required"`
	HalfCheckedKeys []string `json:"halfcheckedkeys" binding:"required"`
}
